package com.hd.openapi.web.interceptor;

import com.hd.openapi.common.Const;
import com.hd.openapi.dao.serMapper;
import com.hd.openapi.entity.AdminUser;
import com.hd.openapi.entity.search;
import com.hd.openapi.servies.logser;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.Nullable;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.Date;

public class logiterceptor implements HandlerInterceptor {
    @Autowired
    private logser lo;
    private serMapper a;

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        //get or post
        String me=request.getMethod ();
        //请求路径
        String url=request.getRequestURL ().toString ();
        //方法名
        System.out.println (new Date ());
        search aa=new search (2,null,null,new Date (),null);
        return true;
    }

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {

        search bb=new search (null,null,new Date (),null);
//       lo.adddata (bb);


    }

}
